Part Number Hot Search : 
78M05 AXLGS52F 16C55 R43391 T1300 BSS79BL 45027 T66N20Q
Product Description
Full Text Search
 

To Download ATMEGA16M1-15AZ Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  features ? high performance, low power avr 8-bit microcontroller ? advanced risc architecture ? 131 powerful instructions - mo st single clock cycle execution ? 32 x 8 general purpose working registers ? fully static operation ? up to 1mips throughput per mhz ? on-chip 2-cycle multiplier ? data and non-volatile program memory ? 16k/32k/64k bytes flash of in-system programmable program memory ? endurance: 10,000 write/erase cycles ? optional boot code section with independent lock bits ? in-system programming by on-chip boot program ? true read-while-w rite operation ? 512/1024/2048 bytes of in-system programmable eeprom ? endurance: 100,000 write/erase cycles ? programming lock fo r flash program and eeprom data security ? 1024/2048/4096 bytes internal sram ? on chip debug interface (debugwire) ? can 2.0a/b with 6 message objects - iso 16845 certified (1) ? lin 2.1 and 1.3 controller or 8-bit uart ? one 12-bit high speed psc (power stag e controller) (only atmega16/32/64m1) ? non overlapping inverted pwm output pins with flexible dead-time ? variable pwm duty cycle and frequency ? synchronous update of all pwm registers ? auto stop function for emergency event ? peripheral features ? one 8-bit general purpose timer/counter with separate prescaler, compare mode and capture mode ? one 16-bit general purpose timer/coun ter with separate prescaler, compare mode and capture mode ? one master/slave spi serial interface ? 10-bit adc ? up to 11 single ended channels and 3 fully differential adc channel pairs ? programmable gain (5x, 10x, 2 0x, 40x) on differ ential channels ? internal reference voltage ? direct power supply voltage measurement ? 10-bit dac for variable voltage reference (comparators, adc) ? four analog comparators with variable threshold detection ? 100a 6% current source (lin node identification) ? interrupt and wake-up on pin change ? programmable watchdog timer with separate on-chip oscillator ? on-chiptemperature sensor ? special microcontroller features ? low power idle, noise reduction, and power down modes ? power on reset and programmable brown out detection ? in-system programmable via spi port ? high precision crysta l oscillator for can operations (16mhz) 1. see certification on atmel ? web site. 8-bit microcontroller with 16k/32k/64k bytes in-system programmable flash atmel atmega16m1 atmega32m1 atmega64m1 atmega32c1 atmega64c1 automotive summary 7647es?avr?07/12
2 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 ? internal calibrated rc oscillator (8mhz) ? on-chip pll for fast pwm (32mhz, 64mhz) and cpu (16mhz) (only atmega16/32/64m1) ? operating voltage: ? 2.7v - 5.5v ? extended operating temperature: ? ?40c to +125c ? core speed grade: ? 0 - 8mhz at 2.7 - 4.5v ? 0 - 16mhz at 4.5 - 5.5v table 0-1. atmega32/64/m1/c1 product line-up part number atmega32c1 atmega64c1 atmega16m1 atmega32m1 atmega64m1 flash size 32 kbyte 64 kbyte 16 kbyte 32 kbyte 64 kbyte ram size 2048 bytes 4096 bytes 1024 bytes 2048 bytes 4096 bytes eeprom size 1024 bytes 2048 bytes 512 bytes 1024 bytes 2048 bytes 8-bit timer yes 16-bit timer yes psc no yes pwm outputs 4 4 10 10 10 fault inputs (psc) 0 0 3 3 3 pll no yes 10-bit adc channels 11 single 3 differential 10-bit dac yes analog comparators 4 current source yes can ye s lin/uart yes on-chip temp. sensor yes spi interface yes
3 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 1. pin configurations figure 1-1. atmega16/32/64m1 tqfp32/qfn32 (7*7 mm) package note: on the engineering samples (parts marked at90pw m324), the acmpn3 alternate function is not located on pc4. it is located on pe2. 1 2 3 4 5 6 7 8 24 2 3 22 21 20 19 1 8 17 (pcint1 8 /p s cin2/oc1a/mi s o_a) pd2 (pcint19/txd/txlin/oc0a/ ss /mo s i_a) pd 3 (pcint9/p s cin1/oc1b/ ss _a) pc1 vcc gnd (pcint10/t0/txcan) pc2 (pcint11/t1/rxcan/icp1b) pc 3 (pcint0/mi s o/p s cout2a) pb0 pb4 (amp0+/pcint4) pb 3 (amp0-/pcint 3 ) pc6 (adc10/acmp1/pcint14) aref(i s rc) agnd avcc pc5 (adc9/acmp 3 /amp1+/pcint1 3 ) pc4 (adc 8 /acmpn 3 /amp1-/pcint12) 3 2 3 1 3 0 29 2 8 27 26 25 9 10 11 12 1 3 14 15 16 (pcint1/mo s i/p s cout2b) pb1 (pcint25/oc0b/xtal1) pe1 (pcint26/adc0/xtal2) pe2 (pcint20/adc1/rxd/rxlin/icp1a/ s ck_a) pd4 (adc2/acmp2/pcint21) pd5 (adc 3 /acmpn2/int0/pcint22) pd6 (acmp0/pcint2 3 ) pd7 (adc5/int1/acmpn0/pcint2) pb2 pd1 (pcint17/p s cin0/clko) pe0 (pcint24/re s et/ocd) pc0 (pcint 8 /int 3 /p s cout1a) pd0 (pcint16/p s cout0a) pb7 (adc4/p s cout0b/ s ck/pcint7) pb6 (adc7/p s cout1b/pcint6) pb5 (adc6/int2/acmpn1/amp2-/pcint5) pc7 (d2a/amp2+/pcint15)
4 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 figure 1-2. atmega32/64c1 tqfp32/qfn32 (7*7 mm) package note: on the first engineering samples (parts marked at90pwm324), the acmpn3 alternate function is not located on pc4. it is located on pe2. 1 2 3 4 5 6 7 8 24 23 22 21 20 19 18 17 (pcint18/oc1a/miso_a) pd2 (pcint19/txd/txlin/oc0a/ss/mosi_a) pd3 (pcint9/oc1b/ss_a) pc1 vcc gnd (pcint10/t0/txcan) pc2 (pcint11/t1/rxcan/icp1b) pc3 (pcint0/miso) pb0 pb4 (amp0+/pcint4) pb3 (amp0-/pcint3) pc6 (adc10/acmp1/pcint14) aref(isrc) agnd avcc pc5 (adc9/acmp3/amp1+/pcint13) pc4 (adc8/acmpn3/amp1-/pcint12) 32 31 30 29 28 27 26 25 9 10 11 12 13 14 15 16 (pcint1/mosi) pb1 (pcint25/oc0b/xtal1) pe1 (pcint26/adc0/xtal2) pe2 (pcint20/adc1/rxd/rxlin/icp1a/sck_a) pd4 (adc2/acmp2/pcint21) pd5 (adc3/acmpn2/int0/pcint22) pd6 (acmp0/pcint23) pd7 (adc5/int1/acmpn0/pcint2) pb2 pd1 (pcint17/clko) pe0 (pcint24/reset/ocd) pc0 (pcint8/int3) pd0 (pcint16) pb7 (adc4/sck/pcint7) pb6 (adc7pcint6) pb5 (adc6/int2/acmpn1/amp2-/pcint5) pc7 (d2a/amp2+/pcint15)
5 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 1.1 pin descriptions : table 1-1. pin out description qfn32 pin number mnemonic type name, function and alternate function 5gndpower ground: 0v reference 20 agnd power analog ground: 0v reference for analog part 4 vcc power power supply 19 avcc power analog power supply: this is the power supply voltage for analog part for a normal use this pin must be connected. 21 aref power analog reference : reference for analog converter . this is the reference voltage of the a/d converter. as output, can be used by external analog isrc (current source output) 8 pb0 i/o miso (spi master in slave out) pscout2a (psc module 2 output a) pcint0 (pin change interrupt 0) 9 pb1 i/o mosi (spi master out slave in) pscout2b (psc module 2 output b) pcint1 (pin change interrupt 1) 16 pb2 i/o adc5 (analog input channel 5 ) int1 (external interrupt 1 input) acmpn0 (analog comparator 0 negative input) pcint2 (pin change interrupt 2) 23 pb3 i/o amp0- (analog differential amplifier 0 negative input) pcint3 (pin change interrupt 3) 24 pb4 i/o amp0+ (analog differential amplifier 0 positive input) pcint4 (pin change interrupt 4) 26 pb5 i/o adc6 (analog input channel 6) int2 (external interrupt 2 input) acmpn1 (analog comparator 1 negative input) amp2- (analog differential amplifier 2 negative input) pcint5 (pin change interrupt 5) 27 pb6 i/o adc7 (analog input channel 7) pscout1b (psc module 1 output a) pcint6 (pin change interrupt 6) 28 pb7 i/o adc4 (analog input channel 4) pscout0b (psc module 0 output b) sck (spi clock) pcint7 (pin change interrupt 7) note: 1. on the first engineering samples (parts marked at90pwm324), the acmpn3 alternate func- tion is not located on pc4. it is located on pe2.
6 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 30 pc0 i/o pscout1a (psc module 1 output a) int3 (external interrupt 3 input) pcint8 (pin change interrupt 8) 3pc1i/o pscin1 (psc digital input 1) oc1b (timer 1 output compare b) ss_a (alternate spi slave select) pcint9 (pin change interrupt 9) 6pc2i/o t0 (timer 0 clock input) txcan (can transmit output) pcint10 (pin change interrupt 10) 7pc3i/o t1 (timer 1 clock input) rxcan (can receive input) icp1b (timer 1 input capture alternate b input) pcint11 (pin change interrupt 11) 17 pc4 i/o adc8 (analog input channel 8) amp1- (analog differential amplifier 1 negative input) acmpn3 (analog comparator 3 negative input) pcint12 (pin change interrupt 12) 18 pc5 i/o adc9 (analog input channel 9) amp1+ (analog differential amplifier 1 positive input) acmp3 (analog comparator 3 positive input) pcint13 (pin change interrupt 13) 22 pc6 i/o adc10 (analog input channel 10) acmp1 (analog comparator 1 positive input) pcint14 (pin change interrupt 14) 25 pc7 i/o d2a (dac output) amp2+ (analog differential amplifier 2 positive input) pcint15 (pin change interrupt 15) 29 pd0 i/o pscout0a (psc module 0 output a) pcint16 (pin change interrupt 16) 32 pd1 i/o pscin0 (psc digital input 0) clko (system clock output) pcint17 (pin change interrupt 17) 1pd2i/o oc1a (timer 1 output compare a) pscin2 (psc digital input 2) miso_a (programming & altern ate spi master in slave out) pcint18 (pin change interrupt 18) table 1-1. pin out description (continued) qfn32 pin number mnemonic type name, function and alternate function note: 1. on the first engineering samples (parts marked at90pwm324), the acmpn3 alternate func- tion is not located on pc4. it is located on pe2.
7 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 2pd3i/o txd (uart tx data) txlin (lin transmit output) oc0a (timer 0 output compare a) ss (spi slave select) mosi_a (programming & altern ate master out spi slave in) pcint19 (pin change interrupt 19) 12 pd4 i/o adc1 (analog input channel 1) rxd (uart rx data) rxlin (lin receive input) icp1a (timer 1 input capture alternate a input) sck_a (programming & alternate spi clock) pcint20 (pin change interrupt 20) 13 pd5 i/o adc2 (analog input channel 2) acmp2 (analog comparator 2 positive input) pcint21 (pin change interrupt 21) 14 pd6 i/o adc3 (analog input channel 3) acmpn2 (analog comparator 2 negative input) int0 (external interrupt 0 input) pcint22 (pin change interrupt 22) 15 pd7 i/o acmp0 (analog comparator 0 positive input) pcint23 (pin change interrupt 23) 31 pe0 i/o or i reset (reset input) ocd (on chip debug i/o) pcint24 (pin change interrupt 24) 10 pe1 i/o xtal1 (xtal input) oc0b (timer 0 output compare b) pcint25 (pin change interrupt 25) 11 pe2 i/o xtal2 (xtal output) adc0 (analog input channel 0) pcint26 (pin change interrupt 26) table 1-1. pin out description (continued) qfn32 pin number mnemonic type name, function and alternate function note: 1. on the first engineering samples (parts marked at90pwm324), the acmpn3 alternate func- tion is not located on pc4. it is located on pe2.
8 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 2. overview the atmega16/32/64/m1/c1 is a low-power cmos 8-bit microcontroller based on the avr enhanced risc architecture. by executing powerful instructions in a single clock cycle, the atmega16/32/64/m1/c1 achieves throughputs approaching 1 mips per mhz allowing the sys- tem designer to optimize power cons umption versus processing speed. 2.1 block diagram figure 2-1. block diagram the avr core combines a rich instruction set with 32 general purpose working registers. all the 32 registers are directly connected to the arithmetic logic unit (alu), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. the resulting architecture is more code efficient while achiev ing throughputs up to ten times faster than con- ventional cisc microcontrollers. flash program memory instruction register instruction decoder program counter control lines 32 x 8 general purpose registrers alu status and control i/o lines eeprom data bus 8-bit data sram direct addressing indirect addressing interrupt unit spi unit watchdog timer 4 analog comparators dac adc mpsc timer 1 timer 0 hw lin/uart can current source
9 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 the atmega16/32/64/m1/c1 provides the following features: 16k/32k/64k bytes of in-system programmable flash with read-while-write capabilities, 512/1024/2048 bytes eeprom, 1024/2048/4096 bytes sram, 27 general purpose i/o lines, 32 general pur pose working regis- ters, one motor power stage controller, two flexible timer/counters with compare modes and pwm, one uart with hw lin, an 11-channel 10-b it adc with two differential input stages with programmable gain, a 10-bit dac, a programmable watchdog timer with internal individual oscillator, an spi serial port, an on-chip debug system and four software select able power sav- ing modes. the idle mode stops the cpu while allowin g the sram, timer/coun ters, spi ports, can, lin/uart and interrupt system to continue functioning. the power-down mode saves the regis- ter contents but freezes the osc illator, disabling all ot her chip functions unt il the next interrupt or hardware reset. the adc noise reduction mode stops the cpu and all i/o modules except adc, to minimize switching noise during adc co nversions. in standby mode, the crystal/reso- nator oscillator is running while the rest of the dev ice is sleeping. this allows very fast start-up combined with low power consumption. the device is manufactured using atmel?s high-density nonvolatile memory technology. the on-chip isp flash allows the program memory to be reprogrammed in -system through an spi serial interface, by a conventi onal nonvolatile memory programmer, or by an on-chip boot pro- gram running on the avr core. the boot program can use any interface to download the application program in the application flash memo ry. software in the boot flash section will continue to run while the application flash se ction is updated, providing true read-while-write operation. by combining an 8-bit risc cpu with in-system self-programmable flash on a monolithic chip, the atmel atmega16/32/64/m1/c1 is a powerful microcontroller that provides a highly flexible and cost effective solution to many embedded control applications. the atmega16/32/64/m1/c1 avr is supported with a full suite of program and system develop- ment tools including: c compilers, macro assemblers, program debugger/simulators, in-circuit emulators, and evaluation kits. 2.2 automotive quality grade the atmega16/32/64/m1/c1 have been developed and manufactured according to the most stringent requirements of the international standard iso-ts-16949. this data sheet contains limit values extracted from the results of exte nsive characterization (temperature and voltage). the quality and reliability of the atmega16/32/ 64/m1/c1 have been verifi ed during re gular prod- uct qualification as per aec-q100 grade 1. as indicated in the ordering information paragraph, the products are available in only one tem- perature grade. table 2-1. temperature grade identification for automotive products temperature temperature identifier comments -40c; +125c z full automotive temperature range
10 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 2.3 pin descriptions 2.3.1 vcc digital supply voltage. 2.3.2 gnd ground. 2.3.3 port b (pb7..pb0) port b is an 8-bit bi-directional i/o port with internal pull-up resistors (selected for each bit). the port b output buffers have symmetrical drive characteristics with both high sink and source capability. as inputs, port b pi ns that are externally pulled low will source current if the pull-up resistors are activated. the port b pins are tri-stated when a reset condition becomes active, even if the clock is not running. port b also serves the functions of various special features of the atmega16/32/64/m1/c1. 2.3.4 port c (pc7..pc0) port c is an 8-bit bi-directional i/o port with internal pull-up resistors (selected for each bit). the port c output buffers have symmetrical drive c haracteristics with bot h high sink and source capability. as inputs, port c pi ns that are externally pulled lo w will source current if the pull-up resistors are activated. the port c pins are tri-stated when a reset condition becomes active, even if the clock is not running. port c also serves the functions of spec ial features of the atmega16/32/64/m1/c1. 2.3.5 port d (pd7..pd0) port d is an 8-bit bi-directional i/o port with internal pull-up resistors (selected for each bit). the port d output buffers have symmetrical drive c haracteristics with bot h high sink and source capability. as inputs, port d pi ns that are externally pulled lo w will source current if the pull-up resistors are activated. the port d pins are tri-stated when a reset condition becomes active, even if the clock is not running. port d also serves the functions of various special features of the atmega16/32/64/m1/c1. 2.3.6 port e (pe2..0) reset/ xtal1/ xtal2 port e is an 3-bit bi-directional i/o port with internal pull-up resistors (selected for each bit). the port e output buffers have symmetrical drive characteristics with both high sink and source capability. as inputs, port e pi ns that are externally pulled low will source current if the pull-up resistors are activated. the port e pins are tri-stated when a reset condition becomes active, even if the clock is not running. if the rstdisbl fuse is programmed, pe0 is used as an i/o pin. note that the electrical char- acteristics of pe0 differ from those of the other pins of port e. if the rstdisbl fuse is unprogrammed, pe0 is us ed as a reset input. a low level on this pin for longer than the minimum puls e length will generate a reset, even if the clock is not running. depending on the clock selection fuse settings, pe1 can be used as input to the inverting oscil- lator amplifier and input to the internal clock operating circuit. depending on the clock selection fuse settings, pe2 can be used as output from the inverting oscillator amplifier.
11 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 2.3.7 avcc avcc is the supply voltage pin for the a/d converter, d/a converter, current source. it should be externally connected to v cc , even if the adc, dac are not us ed. if the adc is used, it should be connected to v cc through a low-pass filter. 2.3.8 aref this is the analog reference pin for the a/d converter. 2.4 about code examples this documentation contains simple code examples that briefly show how to use various parts of the device. these code examples assume that the part specific header file is included before compilation. be aware that not all c compiler vendors include bit definitions in the header files and interrupt handling in c is compiler dependent. please confirm with the c compiler documen- tation for more details.
12 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 3. instruction set summary mnemonics operands description operation flags #clocks arithmetic and logic instructions add rd, rr add two registers rd rd + rr z,c,n,v,h 1 adc rd, rr add with carry two registers rd rd + rr + c z,c,n,v,h 1 adiw rdl,k add immediate to word rdh:rdl rdh:rdl + k z,c,n,v,s 2 sub rd, rr subtract two registers rd rd - rr z,c,n,v,h 1 subi rd, k subtract constant from register rd rd - k z,c,n,v,h 1 sbc rd, rr subtract with carry two registers rd rd - rr - c z,c,n,v,h 1 sbci rd, k subtract with carry constant from reg. rd rd - k - c z,c,n,v,h 1 sbiw rdl,k subtract immediate from word rdh:rdl rdh:rdl - k z,c,n,v,s 2 and rd, rr logical and registers rd rd ? rr z,n,v 1 andi rd, k logical and register and constant rd rd ? k z,n,v 1 or rd, rr logical or registers rd rd v rr z,n,v 1 ori rd, k logical or register and constant rd rd v k z,n,v 1 eor rd, rr exclusive or registers rd rd rr z,n,v 1 com rd one?s complement rd 0xff - rd z,c,n,v 1 neg rd two?s complement rd 0x00 - rd z,c,n,v,h 1 sbr rd,k set bit(s) in register rd rd v k z,n,v 1 cbr rd,k clear bit(s) in register rd rd (0xff - k) z,n,v 1 inc rd increment rd rd + 1 z,n,v 1 dec rd decrement rd rd - 1 z,n,v 1 tst rd test for zero or minus rd rd ? rd z,n,v 1 clr rd clear register rd rd rd z,n,v 1 ser rd set register rd 0xff none 1 mul rd, rr multiply unsigned r1:r0 rd x rr z,c 2 muls rd, rr multiply signed r1:r0 rd x rr z,c 2 mulsu rd, rr multiply signed with unsigned r1:r0 rd x rr z,c 2 fmul rd, rr fractional multiply unsigned r1:r0 (rd x rr) << 1 z,c 2 fmuls rd, rr fractional multiply signed r1:r0 (rd x rr) << 1 z,c 2 fmulsu rd, rr fractional multiply signed with unsigned r1:r0 (rd x rr) << 1 z,c 2 branch instructions rjmp k relative jump pc pc + k + 1 none 2 ijmp indirect jump to (z) pc z none 2 jmp(*) k direct jump pc knone3 rcall k relative subroutine call pc pc + k + 1 none 3 icall indirect call to (z) pc znone3 call(*) k direct subroutine call pc knone4 ret subroutine return pc stack none 4 reti interrupt return pc stack i 4 cpse rd,rr compare, skip if equal if (rd = rr) pc pc + 2 or 3 none 1/2/3 cp rd,rr compare rd - rr z, n,v,c,h 1 cpc rd,rr compare with carry rd - rr - c z, n,v,c,h 1 cpi rd,k compare register with immediate rd - k z, n,v,c,h 1 sbrc rr, b skip if bit in register cleared if (rr(b)=0) pc pc + 2 or 3 none 1/2/3 sbrs rr, b skip if bit in register is set if (rr(b)=1) pc pc + 2 or 3 none 1/2/3 sbic p, b skip if bit in i/o register cleared if (p(b)=0) pc pc + 2 or 3 none 1/2/3 sbis p, b skip if bit in i/o r egister is set if (p(b)=1) pc pc + 2 or 3 none 1/2/3 brbs s, k branch if status flag set if (sreg(s) = 1) then pc pc+k + 1 none 1/2 brbc s, k branch if status flag cleared if (sreg(s) = 0) then pc pc+k + 1 none 1/2 breq k branch if equal if (z = 1) then pc pc + k + 1 none 1/2 brne k branch if not equal if (z = 0) then pc pc + k + 1 none 1/2 brcs k branch if carry set if (c = 1) then pc pc + k + 1 none 1/2 brcc k branch if carry cleared if (c = 0) then pc pc + k + 1 none 1/2 brsh k branch if same or higher if (c = 0) then pc pc + k + 1 none 1/2 brlo k branch if lower if (c = 1) then pc pc + k + 1 none 1/2 brmi k branch if minus if (n = 1) then pc pc + k + 1 none 1/2 brpl k branch if plus if (n = 0) then pc pc + k + 1 none 1/2 brge k branch if greater or equal, signed if (n v= 0) then pc pc + k + 1 none 1/2 brlt k branch if less than zero, signed if (n v= 1) then pc pc + k + 1 none 1/2 brhs k branch if half carry flag set if (h = 1) then pc pc + k + 1 none 1/2 brhc k branch if half carry flag cleared if (h = 0) then pc pc + k + 1 none 1/2 brts k branch if t flag set if (t = 1) then pc pc + k + 1 none 1/2 brtc k branch if t flag cleared if (t = 0) then pc pc + k + 1 none 1/2 brvs k branch if overflow flag is set if (v = 1) then pc pc + k + 1 none 1/2 brvc k branch if overflow flag is cleared if (v = 0) then pc pc + k + 1 none 1/2 brie k branch if interrupt enabled if ( i = 1) then pc pc + k + 1 none 1/2
13 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 brid k branch if interrupt disabled if ( i = 0) then pc pc + k + 1 none 1/2 bit and bit-test instructions sbi p,b set bit in i/o register i/o(p,b) 1none2 cbi p,b clear bit in i/o register i/o(p,b) 0none2 lsl rd logical shift left rd(n+1) rd(n), rd(0) 0 z,c,n,v 1 lsr rd logical shift right rd(n) rd(n+1), rd(7) 0 z,c,n,v 1 rol rd rotate left through carry rd(0) c,rd(n+1) rd(n),c rd(7) z,c,n,v 1 ror rd rotate right through carry rd(7) c,rd(n) rd(n+1),c rd(0) z,c,n,v 1 asr rd arithmetic shift right rd(n) rd(n+1), n=0..6 z,c,n,v 1 swap rd swap nibbles rd(3..0) rd(7..4),rd(7..4) rd(3..0) none 1 bset s flag set sreg(s) 1 sreg(s) 1 bclr s flag clear sreg(s) 0 sreg(s) 1 bst rr, b bit store from register to t t rr(b) t 1 bld rd, b bit load from t to register rd(b) tnone1 sec set carry c 1c1 clc clear carry c 0 c 1 sen set negative flag n 1n1 cln clear negative flag n 0 n 1 sez set zero flag z 1z1 clz clear zero flag z 0 z 1 sei global interrupt enable i 1i1 cli global interrupt disable i 0 i 1 ses set signed test flag s 1s1 cls clear signed test flag s 0 s 1 sev set twos complement overflow. v 1v1 clv clear twos complement overflow v 0 v 1 set set t in sreg t 1t1 clt clear t in sreg t 0 t 1 seh set half carry flag in sreg h 1h1 clh clear half carry flag in sreg h 0 h 1 data transfer instructions mov rd, rr move between registers rd rr none 1 movw rd, rr copy register word rd+1:rd rr+1:rr none 1 ldi rd, k load immediate rd knone1 ld rd, x load indirect rd (x) none 2 ld rd, x+ load indirect and post-inc. rd (x), x x + 1 none 2 ld rd, - x load indirect and pre-dec. x x - 1, rd (x) none 2 ld rd, y load indirect rd (y) none 2 ld rd, y+ load indirect and post-inc. rd (y), y y + 1 none 2 ld rd, - y load indirect and pre-dec. y y - 1, rd (y) none 2 ldd rd,y+q load indirect with displacement rd (y + q) none 2 ld rd, z load indirect rd (z) none 2 ld rd, z+ load indirect and post-inc. rd (z), z z+1 none 2 ld rd, -z load indirect and pre-dec. z z - 1, rd (z) none 2 ldd rd, z+q load indirect with displacement rd (z + q) none 2 lds rd, k load direct from sram rd (k) none 2 st x, rr store indirect (x) rr none 2 st x+, rr store indirect and post-inc. (x) rr, x x + 1 none 2 st - x, rr store indirect and pre-dec. x x - 1, (x) rr none 2 st y, rr store indirect (y) rr none 2 st y+, rr store indirect and post-inc. (y) rr, y y + 1 none 2 st - y, rr store indirect and pre-dec. y y - 1, (y) rr none 2 std y+q,rr store indirect with displacement (y + q) rr none 2 st z, rr store indirect (z) rr none 2 st z+, rr store indirect and post-inc. (z) rr, z z + 1 none 2 st -z, rr store indirect and pre-dec. z z - 1, (z) rr none 2 std z+q,rr store indirect with displacement (z + q) rr none 2 sts k, rr store direct to sram (k) rr none 2 lpm load program memory r0 (z) none 3 lpm rd, z load program memory rd (z) none 3 lpm rd, z+ load program memory and post-inc rd (z), z z+1 none 3 spm store program memory (z) r1:r0 none - in rd, p in port rd pnone1 out p, rr out port p rr none 1 push rr push register on stack stack rr none 2 pop rd pop register from stack rd stack none 2 mnemonics operands description operation flags #clocks
14 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 note: 1. these instructions are only available in ?16k and 32k parts? mcu control instructions nop no operation none 1 sleep sleep (see specific descr. for sleep function) none 1 wdr watchdog reset (see specific descr. for wdr/timer) none 1 break break for on-chip debug only none n/a mnemonics operands description operation flags #clocks
15 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 4. register summary address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 (0xff) reserved ? ? ? ? ? ? ? ? (0xfe) reserved ? ? ? ? ? ? ? ? (0xfd) reserved ? ? ? ? ? ? ? ? (0xfc) reserved ? ? ? ? ? ? ? ? (0xfb) reserved ? ? ? ? ? ? ? ? (0xfa) canmsg msg 7 msg 6 msg 5 msg 4 msg 3 msg 2 msg 1 msg 0 (0xf9) canstmph timstm15 timstm14 timstm13 timstm12 timstm11 timstm10 timstm9 timstm8 (0xf8) canstmpl timstm7 timstm6 timstm5 timstm4 timstm3 timstm2 timstm1 timstm0 (0xf7) canidm1 idmsk 28 idmsk 27 idmsk 26 idmsk 25 idmsk 24 idmsk 23 idmsk 22 idmsk 21 (0xf6) canidm2 idmsk 20 idmsk 19 idmsk 18 idmsk 17 idmsk 16 idmsk 15 idmsk 14 idmsk 13 (0xf5) canidm3 idmsk 12 idmsk 11 idmsk 10 idmsk 9 idmsk 8 idmsk 7 idmsk 6 idmsk 5 (0xf4) canidm4 idmsk 4 idmsk 3 idmsk 2 idmsk 1 idmsk 0rtrmsk ?idemsk (0xf3) canidt1 idt 28 idt 27 idt 26 idt 25 idt 24 idt 23 idt 22 idt 21 (0xf2) canidt2 idt 20 idt 19 idt 18 idt 17 idt 16 idt 15 idt 14 idt 13 (0xf1) canidt3 idt 12 idt 11 idt 10 idt 9 idt 8 idt 7 idt 6 idt 5 (0xf0) canidt4 idt 4 idt 3 idt 2 idt 1 idt 0 rtrtag rb1tag rb0tag (0xef) cancdmob conmob1 conmob0 rplv ide dlc3 dlc2 dlc1 dlc0 (0xee) canstmob dlcw txok rxok berr serr cerr ferr aerr (0xed) canpage mobnb3 mobnb2 mobnb1 mobnb0 ainc indx2 indx1 indx0 (0xec) canhpmob hpmob3 hpmob2 hpmob1 hp mob0 cgp3 cgp2 cgp1 cgp0 (0xeb) canrec rec7 rec6 rec5 rec4 rec3 rec2 rec1 rec0 (0xea) cantec tec7 tec6 tec5 tec4 tec3 tec2 tec1 tec0 (0xe9) canttch timttc15 timttc14 timttc13 timttc12 timttc11 timttc10 timttc9 timttc8 (0xe8) canttcl timttc7 timttc6 timttc5 timttc4 t imttc3 timttc2 timttc1 timttc0 (0xe7) cantimh cantim15 cantim14 cantim13 cantim12 cantim11 cantim10 cantim9 cantim8 (0xe6) cantiml cantim7 cantim6 cantim5 cantim4 cantim3 cantim2 cantim1 cantim0 (0xe5) cantcon tprsc7 tprsc6 tprsc5 tprsc4 tprsc3 tprsc2 trpsc1 tprsc0 (0xe4) canbt3 ? phs22 phs21 phs20 phs12 phs11 phs10 smp (0xe3) canbt2 ? sjw1 sjw0 ? prs2 prs1 prs0 ? (0xe2) canbt1 ? brp5 brp4 brp3 brp2 brp1 brp0 ? (0xe1) cansit1 ? ? ? ? ? ? ? ? (0xe0) cansit2 ? ? sit5 sit4 sit3 sit2 sit1 sit0 (0xdf) canie1 ? ? ? ? ? ? ? ? (0xde) canie2 ? ? iemob5 iemob4 iemob3 iemob2 iemob1 iemob0 (0xdd) canen1 ? ? ? ? ? ? ? ? (0xdc) canen2 ? ? enmob5 enmob4 enmob3 enmob2 enmob1 enmob0 (0xdb) cangie enit enboff enrx entx enerr enbx energ enovrt (0xda) cangit canit boffit ovrtim bxok serg cerg ferg aerg (0xd9) cangsta ?ovrg ? txbsy rxbsy enfg boff errp (0xd8) cangcon abrq ovrq ttc synttc listen test ena/stb swres (0xd7) reserved ? ? ? ? ? ? ? ? (0xd6) reserved ? ? ? ? ? ? ? ? (0xd5) reserved ? ? ? ? ? ? ? ? (0xd4) reserved ? ? ? ? ? ? ? ? (0xd3) reserved ? ? ? ? ? ? ? ? (0xd2) lindat ldata7 ldata6 ldata5 ldata4 ldata3 ldata2 ldata1 ldata0 (0xd1) linsel ? ? ? ? /lainc lindx2 lindx1 lindx0 (0xd0) linidr lp1 lp0 lid5 / ldl1 lid4 / ldl0 lid3 lid2 lid1 lid0 (0xcf) lindlr ltxdl3 ltxdl2 ltxdl1 ltxdl0 lrxdl3 lrxdl2 lrxdl1 lrxdl0 (0xce) linbrrh ? ? ? ? ldiv11 ldiv10 ldiv9 ldiv8 (0xcd) linbrrl ldiv7 ldiv6 ldiv5 ldiv4 ldiv3 ldiv2 ldiv1 ldiv0 (0xcc) linbtr ldisr ? lbt5 lbt4 lbt3 lbt2 lbt1 lbt0 (0xcb) linerr labort ltoerr loverr lferr lserr lperr lcerr lberr (0xca) linenir ? ? ? ? lenerr lenidok lentxok lenrxok (0xc9) linsir lidst2 lidst1 lidst0 lbusy lerr lidok ltxok lrxok (0xc8) lincr lswres lin13 lconf1 lconf0 lena lcmd2 lcmd1 lcmd0 (0xc7) reserved ? ? ? ? ? ? ? ? (0xc6) reserved ? ? ? ? ? ? ? ? (0xc5) reserved ? ? ? ? ? ? ? ? (0xc4) reserved ? ? ? ? ? ? ? ? (0xc3) reserved ? ? ? ? ? ? ? ? (0xc2) reserved ? ? ? ? ? ? ? ? (0xc1) reserved ? ? ? ? ? ? ? ? (0xc0) reserved ? ? ? ? ? ? ? ? (0xbf) reserved ? ? ? ? ? ? ? ?
16 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 (0xbe) reserved ? ? ? ? ? ? ? ? (0xbd) reserved ? ? ? ? ? ? ? ? (0xbc) (5) pifr ? ? ? ? pev2 pev1 pev0 peop (0xbb) (5) pim ? ? ? ? peve2 peve1 peve0 peope (0xba) (5) pmic2 poven2 pisel2 pelev2 pflte2 paoc2 prfm22 prfm21 prfm20 (0xb9) (5) pmic1 poven1 pisel1 pelev1 pflte1 paoc1 prfm12 prfm11 prfm10 (0xb8) (5) pmic0 poven0 pisel0 pelev0 pflte0 paoc0 prfm02 prfm01 prfm00 (0xb7) (5) pctl ppre1 ppre0 pclksel ? ? ? pccyc prun (0xb6) (5) poc ? ? poen2b poen2a poen1b poen1a poen0b poen0a (0xb5) (5) pcnf ? ? pulock pmode popb popa ? ? (0xb4) (5) psync ? ? psync21 psync20 psync11 psync10 psync01 psync00 (0xb3) (5) pocr_rbh ? ? ? ? pocr_rb11 pocr_rb10 pocr_rb9 pocr_rb8 (0xb2) (5) pocr_rbl pocr_rb7 pocr_rb6 pocr_rb 5 pocr_rb4 pocr_rb3 pocr_ rb2 pocr_rb1 pocr_rb0 (0xb1) (5) pocr2sbh ? ? ? ? pocr2sb11 pocr2sb10 pocr2sb9 pocr2sb8 (0xb0) (5) pocr2sbl pocr2sb7 pocr2sb6 pocr2sb5 pocr2sb4 po cr2sb3 pocr2sb2 pocr2sb1 pocr2sb0 (0xaf) (5) pocr2rah ? ? ? ? pocr2ra11 pocr2ra10 pocr2ra9 pocr2ra8 (0xae) (5) pocr2ral pocr2ra7 pocr2ra6 pocr2ra 5 pocr2ra4 pocr2ra3 pocr2 ra2 pocr2ra1 pocr2ra0 (0xad) (5) pocr2sah ? ? ? ? pocr2sa11 pocr2sa10 pocr2sa9 pocr2sa8 (0xac) (5) pocr2sal pocr2sa7 pocr2sa6 pocr2sa5 pocr2sa4 po cr2sa3 pocr2sa2 pocr2sa1 pocr2sa0 (0xab) (5) pocr1sbh ? ? ? ? pocr1sb11 pocr1sb10 pocr1sb9 pocr1sb8 (0xaa) (5) pocr1sbl pocr1sb7 pocr1sb6 pocr1sb5 pocr1sb4 po cr1sb3 pocr1sb2 pocr1sb1 pocr1sb0 (0xa9) (5) pocr1rah ? ? ? ? pocr1ra11 pocr1ra10 pocr1ra9 pocr1ra8 (0xa8) (5) pocr1ral pocr1ra7 pocr1ra6 pocr1ra 5 pocr1ra4 pocr1ra3 pocr1 ra2 pocr1ra1 pocr1ra0 (0xa7) (5) pocr1sah ? ? ? ? pocr1sa11 pocr1sa10 pocr1sa9 pocr1sa8 (0xa6) (5) pocr1sal pocr1sa7 pocr1sa6 pocr1sa5 pocr1sa4 po cr1sa3 pocr1sa2 pocr1sa1 pocr1sa0 (0xa5) (5) pocr0sbh ? ? ? ? pocr0sb11 pocr0sb10 pocr0sb9 pocr0sb8 (0xa4) (5) pocr0sbl pocr0sb7 pocr0sb6 pocr0sb5 pocr0sb4 po cr0sb3 pocr0sb2 pocr0sb1 pocr0sb0 (0xa3) (5) pocr0rah ? ? ? ? pocr0ra11 pocr0ra10 pocr0ra9 pocr0ra8 (0xa2) (5) pocr0ral pocr0ra7 pocr0ra6 pocr0ra 5 pocr0ra4 pocr0ra3 pocr0 ra2 pocr0ra1 pocr0ra0 (0xa1) (5) pocr0sah ? ? ? ? pocr0sa11 pocr0sa10 pocr0sa9 pocr0sa8 (0xa0) (5) pocr0sal pocr0sa7 pocr0sa6 pocr0sa5 pocr0sa4 po cr0sa3 pocr0sa2 pocr0sa1 pocr0sa0 (0x9f) reserved ? ? ? ? ? ? ? ? (0x9e) reserved ? ? ? ? ? ? ? ? (0x9d) reserved ? ? ? ? ? ? ? ? (0x9c) reserved ? ? ? ? ? ? ? ? (0x9b) reserved ? ? ? ? ? ? ? ? (0x9a) reserved ? ? ? ? ? ? ? ? (0x99) reserved ? ? ? ? ? ? ? ? (0x98) reserved ? ? ? ? ? ? ? ? (0x97) ac3con ac3en ac3ie ac3is1 ac3is0 ? ac3m2 ac3m1 ac3m0 (0x96) ac2con ac2en ac2ie ac2is1 ac2is0 ? ac2m2 ac2m1 ac2m0 (0x95) ac1con ac1en ac1ie ac1is1 ac1is0 ac1ice ac1m2 ac1m1 ac1m0 (0x94) ac0con ac0en ac0ie ac0is1 ac0is0 accksel ac0m2 ac0m1 ac0m0 (0x93) reserved ? ? ? ? ? ? ? ? (0x92) dach - / dac9 - / dac8 - / dac7 - / dac6 - / dac5 - / dac4 dac9 / dac3 dac8 / dac2 (0x91) dacl dac7 / dac1 dac6 /dac0 dac5 / - dac4 / - dac3 / - dac2 / - dac1 / - dac0 / (0x90) dacon daate dats2 dats1 dats0 ? dala daoe daen (0x8f) reserved ? ? ? ? ? ? ? ? (0x8e) reserved ? ? ? ? ? ? ? ? (0x8d) reserved ? ? ? ? ? ? ? ? (0x8c) reserved ? ? ? ? ? ? ? ? (0x8b) ocr1bh ocr1b15 ocr1b14 ocr1b13 ocr1b12 ocr1b11 ocr1b10 ocr1b9 ocr1b8 (0x8a) ocr1bl ocr1b7 ocr1b6 ocr1b5 ocr1b4 ocr1b3 ocr1b2 ocr1b1 ocr1b0 (0x89) ocr1ah ocr1a15 ocr1a14 ocr1a13 ocr1a12 ocr1a11 ocr1a10 ocr1a9 ocr1a8 (0x88) ocr1al ocr1a7 ocr1a6 ocr1a5 ocr1a4 ocr1a3 ocr1a2 ocr1a1 ocr1a0 (0x87) icr1h icr115 icr114 icr113 icr112 icr111 icr110 icr19 icr18 (0x86) icr1l icr17 icr16 icr15 icr14 icr13 icr12 icr11 icr10 (0x85) tcnt1h tcnt115 tcnt114 tcnt113 tcnt112 tcnt111 tcnt110 tcnt19 tcnt18 (0x84) tcnt1l tcnt17 tcnt16 tcnt15 tcnt14 tcnt13 tcnt12 tcnt11 tcnt10 (0x83) reserved ? ? ? ? ? ? ? ? (0x82) tccr1c foc1a foc1b ? ? ? ? ? ? (0x81) tccr1b icnc1 ices1 ? wgm13 wgm12 cs12 cs11 cs10 (0x80) tccr1a com1a1 com1a0 com1b1 com1b0 ? ?wgm11wgm10 (0x7f) didr1 ? amp2pd acmp0d amp0pd amp0nd adc10d adc9d adc8d (0x7e) didr0 adc7d adc6d adc5d adc4d adc3d adc2d adc1d adc0d (0x7d) reserved ? ? ? ? ? ? ? ? address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
17 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 (0x7c) admux refs1 refs0 adlar ? mux3 mux2 mux1 mux0 (0x7b) adcsrb adhsm isrcen arefen ? adts3 adts2 adts1 adts0 (0x7a) adcsra aden adsc adate adif adie adps2 adps1 adps0 (0x79) adch - / adc9 - / adc8 - / adc7 - / adc6 - / adc5 - / adc4 adc9 / adc3 adc8 / adc2 (0x78) adcl adc7 / adc1 adc6 / adc0 adc5 / - adc4 / - adc3 / - adc2 / - adc1 / - adc0 / (0x77) amp2csr amp2en amp2is amp2g1 amp2g0 ampcmp2 amp2ts2 amp2ts1 amp2ts0 (0x76) amp1csr amp1en amp1is amp1g1 amp1g0 ampcmp1 amp1ts2 amp1ts1 amp1ts0 (0x75) amp0csr amp0en amp0is amp0g1 amp0g0 ampcmp0 amp0ts2 amp0ts1 amp0ts0 (0x74) reserved ? ? ? ? ? ? ? ? (0x73) reserved ? ? ? ? ? ? ? ? (0x72) reserved ? ? ? ? ? ? ? ? (0x71) reserved ? ? ? ? ? ? ? ? (0x70) reserved ? ? ? ? ? ? ? ? (0x6f) timsk1 ? ?icie1 ? ? ocie1b ocie1a toie1 (0x6e) timsk0 ? ? ? ? ? ocie0b ocie0a toie0 (0x6d) pcmsk3 ? ? ? ? ? pcint26 pcint25 pcint24 (0x6c) pcmsk2 pcint23 pcint22 pcint21 pcint20 pcint19 pcint18 pcint17 pcint16 (0x6b) pcmsk1 pcint15 pcint14 pcint13 pcint12 pcint11 pcint10 pcint9 pcint8 (0x6a) pcmsk0 pcint7 pcint6 pcint5 pcint4 pcint3 pcint2 pcint1 pcint0 (0x69) eicra isc31 isc30 isc21 isc20 isc11 isc10 isc01 isc00 (0x68) pcicr ? ? ? ? pcie3 pcie2 pcie1 pcie0 (0x67) reserved ? ? ? ? ? ? ? ? (0x66) osccal ? cal6 cal5 cal4 cal3 cal2 cal1 cal0 (0x65) reserved ? ? ? ? ? ? ? ? (0x64) prr ? prcan prpsc prtim1 prtim0 prspi prlin pradc (0x63) reserved ? ? ? ? ? ? ? ? (0x62) reserved ? ? ? ? ? ? ? ? (0x61) clkpr clkpce ? ? ? clkps3 clkps2 clkps1 clkps0 (0x60) wdtcsr wdif wdie wdp3 wdce wde wdp2 wdp1 wdp0 0x3f (0x5f) sreg ithsvnz c 0x3e (0x5e) sph sp15 sp14 sp13 sp12 sp11 sp10 sp9 sp8 0x3d (0x5d) spl sp7 sp6 sp5 sp4 sp3 sp2 sp1 sp0 0x3c (0x5c) reserved ? ? ? ? ? ? ? ? 0x3b (0x5b) reserved ? ? ? ? ? ? ? ? 0x3a (0x5a) reserved ? ? ? ? ? ? ? ? 0x39 (0x59) reserved ? ? ? ? ? ? ? ? 0x38 (0x58) reserved ? ? ? ? ? ? ? ? 0x37 (0x57) spmcsr spmie rwwsb sigrd rwwsre blbset pgwrt pgers spmen 0x36 (0x56) reserved ? ? ? ? ? ? ? ? 0x35 (0x55) mcucr spips ? ?pud ? ? ivsel ivce 0x34 (0x54) mcusr ? ? ? ? wdrf borf extrf porf 0x33 (0x53) smcr ? ? ? ? sm2 sm1 sm0 se 0x32 (0x52) msmcr monitor stop mode control register 0x31 (0x51) mondr monitor data register 0x30 (0x50) acsr ac3if ac2if ac1if ac0 if ac3o ac2o ac1o ac0o 0x2f (0x4f) reserved ? ? ? ? ? ? ? ? 0x2e (0x4e) spdr spd7 spd6 spd5 spd4 spd3 spd2 spd1 spd0 0x2d (0x4d) spsr spif wcol ? ? ? ? ?spi2x 0x2c (0x4c) spcr spie spe dord mstr cpol cpha spr1 spr0 0x2b (0x4b) reserved ? ? ? ? ? ? ? ? 0x2a (0x4a) reserved ? ? ? ? ? ? ? ? 0x29 (0x49) pllcsr - - - - - pllf plle plock 0x28 (0x48) ocr0b ocr0b7 ocr0b6 ocr0b5 ocr0b4 ocr0b3 ocr0b2 ocr0b1 ocr0b0 0x27 (0x47) ocr0a ocr0a7 ocr0a6 ocr0a5 ocr0a4 ocr0a3 ocr0a2 ocr0a1 ocr0a0 0x26 (0x46) tcnt0 tcnt07 tcnt06 tcnt05 tcnt04 tcnt03 tcnt02 tcnt01 tcnt00 0x25 (0x45) tccr0b foc0a foc0b ? ? wgm02 cs02 cs01 cs00 0x24 (0x44) tccr0a com0a1 com0a0 com0b1 com0b0 ? ?wgm01wgm00 0x23 (0x43) gtccr tsm icpsel1 ? ? ? ? ? psrsync 0x22 (0x42) eearh ? ? ? ? ? ? eear9 eear8 0x21 (0x41) eearl eear7 eear6 eear5 eear4 eear3 eear2 eear1 eear0 0x20 (0x40) eedr eedr7 eedr6 eedr5 ee dr4 eedr3 eedr2 eedr1 eedr0 0x1f (0x3f) eecr ? ? ? ? eerie eemwe eewe eere 0x1e (0x3e) gpior0 gpior07 gpior06 gpior05 gpior04 gpior03 gpior02 gpior01 gpior00 0x1d (0x3d) eimsk ? ? ? ? int3 int2 int1 int0 0x1c (0x3c) eifr ? ? ? ? intf3 intf2 intf1 intf0 address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
18 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 notes: 1. for compatibility with future devices, reserved bits s hould be written to zero if accessed. reserved i/o memory address es should never be written. 2. i/o registers within the address range 0x00 - 0x1f are directly bit-accessible using the sbi and cbi instructions. in these registers, the value of single bits can be ch ecked by using the sbis and sbic instructions. 3. some of the status flags are cleared by writing a logical o ne to them. note that, unlike most other avrs, the cbi and sbi instructions will only operate on the specif ied bit, and can therefore be used on regi sters containing such status flags. the cbi and sbi instructions work wit h registers 0x00 to 0x1f only. 4. when using the i/o specific commands in and out, the i/o addresses 0x00 - 0x3f must be used. when addressing i/o registers as data space using ld and st instruct ions, 0x20 must be added to these addresses. the atmega16/32/64/m1/c1 is a complex microcontroller with more pe ripheral units than can be supported within the 64 loca- tion reserved in opcode for the in and out instructions. for th e extended i/o space from 0x60 - 0xff in sram, only the st/sts/std and ld/lds/ldd instructions can be used. 5. these registers are only available on atmega32/64m1. for other products described in this datasheet, these locations are reserved. 0x1b (0x3b) pcifr ? ? ? ? pcif3 pcif2 pcif1 pcif0 0x1a (0x3a) gpior2 gpior27 gpior26 gpior25 gpior24 gpior23 gpior22 gpior21 gpior20 0x19 (0x39) gpior1 gpior17 gpior16 gpior15 gpior14 gpior13 gpior12 gpior11 gpior10 0x18 (0x38) reserved ? ? ? ? ? ? ? ? 0x17 (0x37) reserved ? ? ? ? ? ? ? ? 0x16 (0x36) tifr1 ? ?icf1 ? ?ocf1bocf1atov1 0x15 (0x35) tifr0 ? ? ? ? ?ocf0bocf0atov0 0x14 (0x34) reserved ? ? ? ? ? ? ? ? 0x13 (0x33) reserved ? ? ? ? ? ? ? ? 0x12 (0x32) reserved ? ? ? ? ? ? ? ? 0x11 (0x31) reserved ? ? ? ? ? ? ? ? 0x10 (0x30) reserved ? ? ? ? ? ? ? ? 0x0f (0x2f) reserved ? ? ? ? ? ? ? ? 0x0e (0x2e) porte ? ? ? ? ? porte2 porte1 porte0 0x0d (0x2d) ddre ? ? ? ? ? dde2 dde1 dde0 0x0c (0x2c) pine ? ? ? ? ? pine2 pine1 pine0 0x0b (0x2b) portd portd7 portd6 portd5 portd4 portd3 portd2 portd1 portd0 0x0a (0x2a) ddrd ddd7 ddd6 ddd5 ddd4 ddd3 ddd2 ddd1 ddd0 0x09 (0x29) pind pind7 pind6 pind5 pind4 pind3 pind2 pind1 pind0 0x08 (0x28) portc portc7 portc6 portc5 portc4 portc3 portc2 portc1 portc0 0x07 (0x27) ddrc ddc7 ddc6 ddc5 ddc4 ddc3 ddc2 ddc1 ddc0 0x06 (0x26) pinc pinc7 pinc6 pinc5 pinc4 pinc3 pinc2 pinc1 pinc0 0x05 (0x25) portb portb7 portb6 portb5 portb4 portb3 portb2 portb1 portb0 0x04 (0x24) ddrb ddb7 ddb6 ddb5 ddb4 ddb3 ddb2 ddb1 ddb0 0x03 (0x23) pinb pinb7 pinb6 pinb5 pinb4 pinb3 pinb2 pinb1 pinb0 0x02 (0x22) reserved ? ? ? ? ? ? ? ? 0x01 (0x21) reserved ? ? ? ? ? ? ? ? 0x00 (0x20) reserved ? ? ? ? ? ? ? ? address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
19 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 5. errata 5.1 errata summary 5.1.1 atmega16m1/16c1/32m1/32c1 rev. c (mask revision) ? lin break delimiter ? adc with with psc2-synchronized ? adc amplifier measurement is unstable 5.1.2 atmega16m1/16c1/32m1/32c1 rev. b (mask revision) ? the ampcmpx bits return 0 ? no comparison when amplifier is used as comparator input and adc input ? crc calculation of diagnostic frames in lin 2.x. ? wrong tsoffset manufacturing calibration value ? pd0-pd3 set to outputs and pd4 pulled down fo llowing power-on with external reset active. ? lin break delimiter ? adc with with psc2-synchronized ? adc amplifier measurement is unstable ? psc emulation ? read / write instructions of muxn and refs1:0 5.1.3 atmega16m1/16c1/32m1/32c1 rev. a (mask revision) ? inopportune reset of the canidm registers ? the ampcmpx bits return 0 ? no comparison when amplifier is used as comparator input and adc input ? crc calculation of diagnostic frames in lin 2.x ? pd0-pd3 set to outputs and pd4 pulled down following power-on with external reset active ? lin break delimiter ? adc with with psc2-synchronized ? adc amplifier measurement is unstable ? psc emulation ? read / write instructions of muxn and refs1:0
20 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 5.1.4 errata description 1. inopportune reset of the canidm registers after the reception of a can frame in a mob, the id mask registers are reset. problem fix / workaround before enabling a mob in reception, re-initialize the id mask registers - canidm[4..1] . 2. the ampcmpx bits return 0 when they are read the ampcmpx bits in ampxcsr registers return 0. problem fix / workaround if the reading of the ampcmpx bits is required, store the ampcmpx value in a variable in memory before writing in the ampxcsr register and read the variable when necessary. 3. no comparison when amplifier is used as comparator input and adc input when it is selected as adc input, an amplifier receives no clock signal when the adc is stopped. in that case, if the amplifier is also used as comparator input, no analog signal is propagated and no comparison is done. problem fix / workaround select another adc channel rather than the working amplified channel. 4. crc calculation of diagnostic frames in lin 2.x. diagnostic frames of lin 2.x use ?classic checksum? calculation. unfortunately, the set- ting of the checksum model is enabled wh en the header is transmitted/received. usually, in lin 2.x the lin/uart controller is initialized to process ?enhanced check- sums? and a slave task does not know what kind of frame it will work on before checking the id. problem fix / workaround this workaround is to be implemented only in case of transmission/reception of diag- nostics frames. a. slave task of master node: before enabling the header, the master must set the appropriate lin13 bitvalue in lincr register. b. for slaves nodes, the workaround is in 2 parts: ? before enabling the response, use the following function: void lin_wa_head( void ) { unsigned char temp; temp = linbtr; lincr = 0x00 ; // it is not a reset ! linbtr = ( 1 < 21 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 5. wrong tsoffset manufacturing calibration value. erroneous value of tsoffset programmed in signature byte. (tsoffset was introduced from revb silicon). problem fix / workaround to identify revb with wrong tsoffset value, check device signature byte at address 0x3f if value is not 0x42 (ascii code ?b?) then use the following formula. ts_offset(true) = (150*(1-ts_gain))+ts_offset. 6. pd0-pd3 set to outputs and pd4 pulled down following power-on with external reset active. at power-on with the external reset signal active the four i/o lines pd0-pd3 may be forced into an output state. normally these lines should be in an input state. pd4 may be pulled down with internal 220 kohm resistor. following release of the reset line (whatever is the startup time) with the cl ock running the i/os pd0-pd4 will adopt their intended input state. problem fix / workaround none 7. lin break delimitter in slave mode, a break field detection er ror can occur under following conditions. the problem occurs if 2 conditions occur simultaneously: a. the dominant part of the break is (n+0.5)*tbit long wit h n=13, 14,15, ... b. the recessive part of the break (break de limiter) is equal to 1*tbit. (see note below) the break_high is not de tected, and the 2nd bi t of the sync field is interprete d as the break delimiter. the error is detected as a framing error on the first bits of the pid or on subsequent data or a checksum error. there is no error if break_high is greater than 1*tbit + 18%. there is no problem in master mode. note: lin2.1 protocol specification paragraph 2.3.1.1 break field says: ?a break field is always gener- ated by the master task(in the master node) an d it shall be at least 13 nominal bit times of dominant value, followed by a break delimiter, as shown in figure 5-1 . the break delimiter shall be at least one nominal bit time long. ? figure 5-1. the break field workaround none fr a me bre a k protected identifier field bre a k field d a t a 1 inter- b yte s p a ce inter- b yte s p a ce bre a k delimiter d a t a 2d a t a n check su m s ync field he a der re s pon s e re s pon s e s p a ce
22 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 8. adc measurement reports abnormal values with psc2-synchronized conver- sions when using adc in synchronized mode, an unexpected extra single ended conversion can spuriously re-start. this can occur when the end of conversion and the trigger event occur at the same time. workaround no workaround 9. adc amplifier measurement is unstable when switching from a single-ended adc channel to an amplified channel, noise can appear on the next adc conversion. workaround after switching from a single ended to an amplified channel, discard the first adc conversion. 10. psc emulation in emulation mode, tcntn, ocrnx and icrn 16-bit registers are accessed via the temp register. this can induce an execution error, in step by step mode due to temp register corruption. workaround no workaround 11. read / write instructions of muxn and refs1:0 bits in the admux register dur- ing analog conversion during analog conversion, the set or clea r instructions of admux channel and refer- ence selection bits will fail.the bits of the te mporary buffer will be written in place of the final bits. workaround wait for the end of adc conversion before any write of new channel or reference selec- tion values in admux.
23 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 6. ordering information note: all packages are pb free, fully lhf 7. package information table 6-1. atmega16/32/64/m1/c1 ordering codes memory size psc power supply ordering code package operation range 16k yes 2.7 - 5.5v mega16m1-15az ma -40c to 125c 16k yes 2.7 - 5.5v mega16m1-15mz pv -40c to 125c 32k no 2.7 - 5.5v mega32c1-15az ma -40c to 125c 32k no 2.7 - 5.5v mega32c1-15mz pv -40c to 125c 32k yes 2.7 - 5.5v mega32m1-15az ma -40c to 125c 32k yes 2.7 - 5.5v mega32m1-15mz pv -40c to 125c 32k yes 2.7 - 5.5v mega32m1-esaz ma engineering samples 32k yes 2.7 - 5.5v mega32m1-esmz pv engineering samples 64k no 2.7 - 5.5v mega64c1-15az ma -40c to 125c 64k no 2.7 - 5.5v mega64c1-15mz pv -40c to 125c 64k no 2.7 - 5.5v mega64c1-esaz ma engineering samples 64k no 2.7 - 5.5v mega64c1-esmz pv engineering samples 64k yes 2.7 - 5.5v mega64m1-15az ma -40c to 125c 64k yes 2.7 - 5.5v mega64m1-15mz pv -40c to 125c 64k yes 2.7 - 5.5v mega64m1-esaz ma engineering samples 64k yes 2.7 - 5.5v mega64m1-esmz pv engineering samples package type ma ma, 32 - lead, 7x7 mm body size, 1.0 mm body thickness 0.8 mm lead pitch, thin profile plastic quad flat package (tqfp) pv pv, 32-lead, 7.0x7.0 mm body, 0.65 mm pitch quad flat no lead package (qfn)
24 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 7.1 tqfp32
25 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 7.2 qfn32
26 7647es?avr?07/12 atmel atmega16/32/64/m1/c1 8. datasheet revision histor y for atmega16/32/64/m1/c1 please note that the following page numbers referred to in this section refer to the specific revi- sion mentioned, not to this document. 8.1 revision 7647es 1. section ?features? on page 2 updated 2. table 0-1 ?atmega32/64/m1/c1 product line-up? on page 2 updated
atmel corporation 2325 orchard parkway san jose, ca 95131 usa tel: (+1)(408) 441-0311 fax: (+1)(408) 487-2600 atmel asia limited unit 01-5 & 16, 19/f bea tower, millennium city 5 418 kwun tong road kwun tong, kowloon hong kong tel: (+852) 2245-6100 fax: (+852) 2722-1369 atmel munich gmbh business campus parkring 4 d-85748 garching b. munich germany tel: (+49) 89-31970-0 fax: (+49) 89-3194621 atmel japan 9f, tonetsu shinkawa bldg. 1-24-8 shinkawa chuo-ku, tokyo 104-0033 japan tel: (+81) (3) 3523-3551 fax: (+81) (3) 3523-7581 ? 2012 atmel corporation. all rights reserved. / rev.: 7647es?avr?07/12 atmel ? , atmel logo and combinations thereof, avr ? , avr ? logo, avr studio ? and others are registered trademarks or trademarks of atmel cor- poration or its subsidiaries. other terms and product names may be trademarks of others. disclaimer: the information in this document is provided in con nection with atmel products. no license, express or implied, by estoppel or otherwise, to any intellec- tual property right is granted by this document or in connection with the sale of atmel products. except as set forth in the at mel terms and conditions of sales located on the atmel website, atmel assumes no liability whatsoever and disclaims any express, implied or statutory warranty relating to its products including, but not limited to, the implied warranty of merchantability, fitness for a particu - lar purpose, or non-infringement. in no event shall atmel be liable for any direct, indirect, consequential, punitive, special or incidental damages (including, without limitation, damages for lo ss and profits, business interruption, or loss of information) arising out of the use or inabil ity to use this document, even if atmel has been advised of the possibility of such damages. at mel makes no representations or warranties with respect to the accura cy or completeness of the contents of this document and reserv es the right to make changes to specifications and products descriptions at any time without not ice. atmel does not make any commitment to update the informati on contained herein. unless specif- ically provided otherwise, atmel produc ts are not suitable for, and shall not be used in, automotive applications. atmel produc ts are not intended, authorized, or war- ranted for use as components in applicatio ns intended to support or sustain life.


▲Up To Search▲   

 
Price & Availability of ATMEGA16M1-15AZ

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X